
#import "LXMessageRepairCarInfo.h"

@implementation LXMessageRepairCarInfo
+(NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{@"carId":@"id"};
}
- (NSData *)encode {
    NSMutableDictionary *multableDict = [NSMutableDictionary dictionary];
    if (self.userId) {
        [multableDict setObject:self.userId forKey:@"userId"];
    } else {
        [multableDict setObject:@"" forKey:@"userId"];
    }
    if (self.userName) {
        [multableDict setObject:self.userName forKey:@"userName"];
    } else {
        [multableDict setObject:@"" forKey:@"userName"];
    }
    if (self.carModelId) {
        [multableDict setObject:self.carModelId forKey:@"carModelId"];
    } else {
        [multableDict setObject:@"" forKey:@"carModelId"];
    }
    if (self.carBrand) {
        [multableDict setObject:self.carBrand forKey:@"carBrand"];
    } else {
        [multableDict setObject:@"" forKey:@"carBrand"];
    }
    if (self.carModel) {
        [multableDict setObject:self.carModel forKey:@"carModel"];
    } else {
        [multableDict setObject:@"" forKey:@"carModel"];
    }
    if (self.engLabel) {
        [multableDict setObject:self.engLabel forKey:@"engLabel"];
    } else {
        [multableDict setObject:@"" forKey:@"engLabel"];
    }
    if (self.engValue) {
        [multableDict setObject:self.engValue forKey:@"engValue"];
    } else {
        [multableDict setObject:@"" forKey:@"engValue"];
    }
    if (self.endurance) {
        [multableDict setObject:self.endurance forKey:@"endurance"];
    } else {
        [multableDict setObject:@"" forKey:@"endurance"];
    }
    if (self.plaLabel) {
        [multableDict setObject:self.plaLabel forKey:@"plaLabel"];
    } else {
        [multableDict setObject:@"" forKey:@"plaLabel"];
    }
    if (self.plaValue) {
        [multableDict setObject:self.plaValue forKey:@"plaValue"];
    } else {
        [multableDict setObject:@"" forKey:@"plaValue"];
    }
    if (self.typeLabel) {
        [multableDict setObject:self.typeLabel forKey:@"typeLabel"];
    } else {
        [multableDict setObject:@"" forKey:@"typeLabel"];
    }
    if (self.typeValue) {
        [multableDict setObject:self.typeValue forKey:@"typeValue"];
    } else {
        [multableDict setObject:@"" forKey:@"typeValue"];
    }
    if (self.rentPrice) {
        [multableDict setObject:self.rentPrice forKey:@"rentPrice"];
    } else {
        [multableDict setObject:@"" forKey:@"rentPrice"];
    }
    if (self.carTypeId) {
        [multableDict setObject:self.carTypeId forKey:@"carTypeId"];
    } else {
        [multableDict setObject:@"" forKey:@"carTypeId"];
    }
    
    return [NSJSONSerialization dataWithJSONObject:multableDict options:kNilOptions error:nil];
}

- (void)decodeWithData:(NSData *)data {
    if (data == nil) return;
    NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
    NSDictionary *json = [[NSDictionary alloc] initWithDictionary:dictionary];
    if (json == nil) return;
    self.userId = [json objectForKey:@"userId"];
    self.userName = [json objectForKey:@"userName"];
    self.carBrand = [json objectForKey:@"carBrand"];
    self.carModelId = [json objectForKey:@"carModelId"];
    self.carModel = [json objectForKey:@"carModel"];
    self.engLabel = [json objectForKey:@"engLabel"];
    self.engValue = [json objectForKey:@"engValue"];
    self.endurance = [json objectForKey:@"endurance"];
    self.plaLabel = [json objectForKey:@"plaLabel"];
    self.plaValue = [json objectForKey:@"plaValue"];
    self.typeLabel = [json objectForKey:@"typeLabel"];
    self.typeValue = [json objectForKey:@"typeValue"];
    self.rentPrice = [json objectForKey:@"rentPrice"];
    self.carTypeId = [json objectForKey:@"carTypeId"];
    
}

+ (NSString *)getObjectName {
  return @"LX:WeNeedCar:Info";
}

- (NSArray<NSString *> *)getSearchableWords {
  return nil;
}

+ (RCMessagePersistent)persistentFlag {
  return 3;
}



- (NSString *)conversationDigest{
    return @"[补车提醒]";
}

@end

